package cn.echogo.framework.http.bak;

import java.util.concurrent.ThreadPoolExecutor;

import android.content.Context;

/**
 * Http客户端调用接口(异步客户端)
 * @author rongxinhua
 * 
 * async-http中存context, 我觉得不好，传一字符串key（如Activity的名字或其他）可能比较好
 *
 */
public interface EGHttpClient {

	/**
	 * Get请求
	 * @param url
	 * @param params
	 * @return
	 * @throws EGHttpException
	 */
	public void get(String url, RequestParams params, EGHttpResponseHandler handler, String token, int seq);
	
	/**
	 * Post请求
	 * @param token
	 * @param url
	 * @param params
	 * @return
	 * @throws EGHttpException
	 */
	public void post(String url, RequestParams params, EGHttpResponseHandler handler, String token, int seq);
	
	/**
	 * 取消请求
	 * @param token
	 * @return
	 */
	public boolean cancel(String token);
	
	/**
	 * 设置超时时间
	 * @param timeout
	 * @return
	 */
	public boolean setTimeout(long timeout);
	
	/**
	 * 设置线程池（作异步操作用）
	 * @param threadPool
	 */
	public void setThreadPool(ThreadPoolExecutor threadPool);
	
}
